package com.jiyun.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Service;

@Service
public class MsgConsumer {

    @RabbitListener(queues = {"xxxx"})
    public void getMessage(@Payload String msg){
        String[] phoneList = msg.split("-");
        for (String phone : phoneList) {
            System.out.println(phone+":消息已发送");
        }
    }

}
